package com.activenetwork.smlite.page;

import org.apache.commons.lang3.StringUtils;

import com.activenetwork.custom.uielement.UIElement;
import com.activenetwork.custom.uielement.decorate.InJson;
import com.activenetwork.smlite.page.event.EventDetailView.EventSourceSubview;
import com.activenetwork.smlite.page.generic.PageObject;
import com.activenetwork.util.PageLoader;

public class EventLeftNavigation implements PageObject {
	
	@InJson
	private UIElement sourcing;
	@InJson
	private UIElement socialMedia;
	@InJson
	private UIElement website;
	@InJson
	private UIElement email;
	@InJson
	private UIElement attendeeDirectories;
	@InJson
	private UIElement registratonForm;
	@InJson
	private UIElement themeDesigner;
	@InJson
	private UIElement mobile;
	@InJson
	private UIElement badgeLabel;
	@InJson
	private UIElement kiosk;
	@InJson
	private UIElement reports;
	@InJson
	private UIElement customReports;
	@InJson
	private UIElement surveys;
	
	/**
	 * Click left navigation sourcing
	 * @return
	 */
	public EventSourceSubview sourcing(){
		String value = sourcing.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation sourcing is either hide or disabled");
		}else{
			sourcing.click();
		}
		return PageLoader.load(EventSourceSubview.class);
	}
	/**
	 * Click left navigation social media
	 * @return
	 */
	public PageObject socialMedia(){
		String value = socialMedia.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation social media is either hide or disabled");
		}else{
			socialMedia.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation website
	 * @return
	 */
	public PageObject website(){
		String value = website.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation website is either hide or disabled");
		}else{
			website.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation email
	 * @return
	 */
	public PageObject email(){
		String value = email.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation email is either hide or disabled");
		}else{
			email.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation attendee directories
	 * @return
	 */
	public PageObject attendeeDirectories(){
		String value = attendeeDirectories.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation attendee directories is either hide or disabled");
		}else{
			attendeeDirectories.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation registration form
	 * @return
	 */
	public PageObject registratonForm(){
		String value = registratonForm.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation registration form is either hide or disabled");
		}else{
			registratonForm.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation theme designer
	 * @return
	 */
	public PageObject themeDesigner(){
		String value = themeDesigner.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation theme designer is either hide or disabled");
		}else{
			themeDesigner.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation mobile
	 * @return
	 */
	public PageObject mobile(){
		String value = mobile.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation mobile is either hide or disabled");
		}else{
			mobile.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation badges & labels
	 * @return
	 */
	public PageObject badgeLabel(){
		String value = badgeLabel.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation badge and lable is either hide or disabled");
		}else{
			badgeLabel.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation kiosk
	 * @return
	 */
	public PageObject kiosk(){
		String value = kiosk.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation kiosk is either hide or disabled");
		}else{
			kiosk.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation reports
	 * @return
	 */
	public PageObject reports(){
		String value = reports.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation reports is either hide or disabled");
		}else{
			reports.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation custom report
	 * @return
	 */
	public PageObject customReports(){
		String value = customReports.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation custom reports is either hide or disabled");
		}else{
			customReports.click();
		}
		return PageLoader.load(new PageObject(){});
	}
	/**
	 * Click left navigation surveys
	 * @return
	 */
	public PageObject surveys(){
		String value = surveys.getAttribute("class");
		if(StringUtils.containsIgnoreCase(value, "hide") ||  StringUtils.containsIgnoreCase(value, "disabled")){
			throw new RuntimeException("Left navigation surveys is either hide or disabled");
		}else{
			surveys.click();
		}
		return PageLoader.load(new PageObject(){});
	}

}
